package com.tqfframe.rabbitmq.listener.dead;

import com.rabbitmq.client.Channel;
import com.tqfframe.rabbitmq.constants.RabbitConstants;
import com.tqfframe.rabbitmq.entity.TestEntity;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.messaging.handler.annotation.Headers;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.util.Map;

/**
 * 死性消息队列监听
 * @author: Qifeng Tang
 * @date: 2022/8/31 11:43
 * @Version 1.0
 **/
@Component
public class DeadReceiver {

    /**
     * 普通消息接收
     */
    @RabbitListener(queues = RabbitConstants.DEAD_COMMON_QUEUE)
    public void receive(String msg){
        System.out.println("我是普通消息队列消费了消息"+msg);
    }

    /**
     * 死性消息接收
     */
    @RabbitListener(queues = RabbitConstants.DEAD_QUEUE)
    public void receive2(String msg){
        System.out.println("死性消息队列消费了消息"+msg);
    }




}
